package com.okilo.online.app.lib.device.util

import android.content.Context
import android.os.Build
import org.json.JSONObject

/**
 * device
 */
class OkiloDev1(val context: Context, val product: String, val token: String, val path: String) {

    fun gOkiloDev1Data(): String? {
        return try {
            val data = JSONObject().apply {
                put("path", path)
                put("token", token)
                put("product", product)
                put("imei", "")
                put("version", "30")
                put("app", product)
                put("manufacturer", Build.MANUFACTURER ?: "")
                put("brand", Build.BRAND ?: "")
                put("deviceName", Build.DEVICE ?: "")
                put("phoneModel", Build.PRODUCT ?: "")
                put("sysVersion", Build.VERSION.RELEASE ?: "")
                put("mac", OkiloDevUtils.gDev1Params7())
                put("laguage", OkiloDevUtils.gDev1AndDec3Params1())
                put("area", OkiloDevUtils.gDev1Params4())
                put("screenHeight", OkiloDevUtils.gDev1Params2(context))
                put("screenWidth", OkiloDevUtils.gDev1Params3(context))
                put("networkData", OkiloDevUtils.gDev1AndDev3Params3(context))
                put("frontCameraPixels", OkiloDevUtils.gDev1Params5(context))
                put("rearCameraPixels", OkiloDevUtils.gDev1Params6(context))
                put("ram", OkiloDevUtils.gDev1AndDev4Params1(context))
                put("rom", OkiloDevUtils.gDev1AndDev4Params2())
                put("ip", OkiloDevUtils.gDev1Params8(context))
                put("ip2", OkiloDevUtils.gDev1Params8(context))
                put("networkEnvironment", OkiloDevUtils.gDev1AndDev3Params2(context))
                put("cpu", OkiloDevUtils.gDev1Params1())
            }
            data.toString()
        } catch (e: Exception) {
            null
        }
    }
}